// 部门相关接口
import request from '@/utils/request'

// 获取部门列表
export function getDepartmentList() {
  return request({
    url: '/company/department'
  })
}

// 新增部门
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

// 根据id获取部门详情
export function getDepartmentDetailById(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 编辑部门详情
export function updateDepartment(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}

// 根据ID删除部门
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
